package cn.ekuma.epos.datalogic.define.dao;

import com.openbravo.data.basic.BasicException;
import com.openbravo.data.loader.DataRead;
import com.openbravo.data.loader.DataWrite;
import com.openbravo.data.loader.Datas;
import com.openbravo.data.loader.Session;
import com.openbravo.data.loader.TableDefinition;
import com.openbravo.data.model.Field;
import com.openbravo.format.Formats;

import cn.ekuma.data.dao.BaseDAO;
import cn.ekuma.epos.symmetricds.bean.RegistrationRequest;

public class RegistrationRequestDAO extends BaseDAO<RegistrationRequest> {

	
	public RegistrationRequestDAO(Session s) {
		super(s);
		// TODO Auto-generated constructor stub
	}

	@Override
	public RegistrationRequest readValues(DataRead dr,RegistrationRequest obj) throws BasicException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public TableDefinition getTable() {
		return new TableDefinition(s,
                "node",
                new Field[]{
                   new Field("node_id",Datas.STRING, Formats.STRING)
                 },
                new int[]{0}
                );
	}

	/**
	 * <table name="registration_request" description="Audits when a node registers or attempts to register.">
        <column name="node_group_id" type="VARCHAR" size="50" description="The node group that this node belongs to, such as 'store'." />
        <column name="external_id" type="VARCHAR" size="50" description="A domain-specific identifier for context within the local system. For example, the retail store number. "/>
        <column name="status" type="CHAR" size="2"  required="true"  description="The current status of the registration attempt.  Valid statuses are NR (not registered), IG (ignored), OK (sucessful)" />
        <column name="host_name" type="VARCHAR" size="60" required="true"  description="The host name of a workstation or server. If more than one instance of SymmetricDS runs on the same server, then this value can be a 'server id' specified by -Druntime.symmetric.cluster.server.id" />
        <column name="ip_address" type="VARCHAR" size="21" required="true"  description="The ip address for the host." />
        <column name="attempt_count" type="INTEGER" default="0" description="The number of registration attempts." />
        <column name="registered_node_id" type="VARCHAR" size="50" description="A unique identifier for a node." />
        <column name="create_time" type="TIMESTAMP" required="true"  description="Timestamp when this entry was created." />
        <column name="last_update_by" type="VARCHAR" size="50"  description="The user who last updated this entry." />
        <column name="last_update_time" type="TIMESTAMP" required="true"  description="Timestamp when a user last updated this entry." />
        <index name="idx_reg_req_1">
            <index-column name="node_group_id"/>
            <index-column name="external_id"/>
            <index-column name="status"/>
            <index-column name="host_name"/>
            <index-column name="ip_address"/>
        </index>
        <index name="idx_reg_req_2">
            <index-column name="status"/>
        </index>
    </table>
	 */
	

	@Override
	public void writeInsertValues(DataWrite dp, RegistrationRequest obj)
			throws BasicException {
		// TODO Auto-generated method stub
		
	}

	@Override
	public Class getSuportClass() {
		// TODO Auto-generated method stub
		return null;
	}

}
